import Vue from 'vue'
import VueRouter from 'vue-router'
// 导入需要组件
import Home from '@/views/Home/Home.vue'
import User from '@/views/User/User.vue'

// 注册VueRouter为vue的插件
Vue.use(VueRouter)

const routes = [
  { path: '/', component: Home },
  { path: '/user', component: User }
]
// 初始化一个路由实例
const router = new VueRouter({
  routes
})

export default router
